﻿using System;

using Guids;

namespace GuidGeneratorSilverlight
{
    public class Options
    {
        private int count;

        public Options()
        {
            this.GuidFormat = GuidFormats.CurlyBraces;
            this.UpperCase = false;
            this.Count = 2;
        }

        public GuidFormats GuidFormat { get; set; }
        public bool UpperCase { get; set; }

        public int Count
        {
            get { return count; }
            set
            {
                if (value < 1 || value > 2000)
                    throw new InvalidOperationException("Please enter a value between 1 and 100");

                count = value;
            }
        }

        public string CountText
        {
            get
            {
                return this.Count.ToString();
            }

            set
            {
                this.Count = int.Parse(value);
            }
        }
    }
}
